<template>
    <el-dialog v-model="show" :title="type == 1 ? '平账历史记录' : '货损抵扣历史记录'" width="45%" align-center @close="handleClose">
        <el-table :data="props.initList" style="width: 100%" v-if="type == 1">
            <el-table-column prop="collectName" label="收款方名称" align="center" />
            <el-table-column label="摘要" align="center">
                <template #default="scope">
                    {{ props.summaryType.filter((item: any) => item.value == scope.row.summary)[0].label }}
                </template>
            </el-table-column>
            <el-table-column prop="totalAmount" label="总金额" align="center" />
            <el-table-column prop="paidAmount" label="已付款金额" align="center" />
            <el-table-column prop="pendingPaymentAmount" label="待付款金额" align="center" />
            <el-table-column prop="operationPersonName" label="平账操作人" align="center" />
            <el-table-column prop="operationDate" label="操作日期" align="center" />
            <el-table-column prop="balanceAmount" label="平账金额" align="center" />
        </el-table>
        <el-table :data="props.initList" style="width: 100%" v-if="type == 2">
            <el-table-column prop="date" label="收款方名称" align="center" />
            <el-table-column prop="name" label="品名规格" align="center" />
            <el-table-column prop="name" label="货损日期" align="center" />
            <el-table-column prop="name" label="货损原因" align="center" />
            <el-table-column prop="name" label="抵扣数量" align="center" />
            <el-table-column prop="name" label="抵扣金额" align="center" />
            <el-table-column prop="name" label="操作人" align="center" />
            <el-table-column prop="name" label="操作日期" align="center" />
        </el-table>
        <template #footer>
            <div class="dialog-footer">
                <el-button type="primary" @click="handleClose">确 定</el-button>
            </div>
        </template>
    </el-dialog>
</template>
<script setup lang="ts">
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const props = defineProps(['visible', 'initList', 'type', 'summaryType']);
const emits = defineEmits(['submit', 'close']);

const show = ref(false);

watch(() => props.visible, async (newValue) => {
    show.value = newValue
    if (newValue) {
    }
}, { deep: true });

const handleClose = () => {
    emits('close');
};

onMounted(() => {
})
</script>

<style lang="scss" scoped></style>